package com.caregiver.watch.business.care.model.vo;

import com.caregiver.watch.common.utils.time.DateUtils;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @Description: 压力值详情数据
 * @program: caregiver-watch
 * @author: 疆戟
 * @create: 2025-10-02 20:36
 */
@Data
@Schema(description = "压力值详情数据")
public class StressValueDetailDataVo {

    @Schema(description = "压力值详情数据列表")
    private List<StressValueDetailData> stressValueDetailDataList;


    public static StressValueDetailDataVo build(List<StressValueDetailData> stressValueDetailDataList) {
        StressValueDetailDataVo stressValueDetailDataVo = new StressValueDetailDataVo();
        stressValueDetailDataVo.stressValueDetailDataList = stressValueDetailDataList;
        return stressValueDetailDataVo;
    }

    @Data
    @Schema(description = "压力值详情数据")
    public static class StressValueDetailData {
        @Schema(description = "时间(分钟)")
        private Integer time;
        @Schema(description = "压力值")
        private Integer stressValue;

        public static StressValueDetailData build(LocalDateTime time, Integer stressValue) {
            StressValueDetailData stressValueDetailData = new StressValueDetailData();
            stressValueDetailData.time = DateUtils.getMinute(time);
            stressValueDetailData.stressValue = stressValue;
            return stressValueDetailData;
        }
    }
}
